package com.zcx.springcloud.payment8001.service.impl;

import com.zcx.springcloud.payment8001.entity.Payment;
import com.zcx.springcloud.payment8001.mapper.PaymentMapper;
import com.zcx.springcloud.payment8001.service.PaymentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PaymentServiceImpl implements PaymentService {

    @Resource
    private PaymentMapper paymentMapper;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int create(Payment payment) {
        return paymentMapper.create(payment);
    }

    @Override
    public Payment getPaymentById(Long id) {
        return paymentMapper.getPaymentById(id);
    }

    @Override
    public List<Payment> selectPaymentList(Payment payment) {
        return paymentMapper.selectPaymentList(payment);
    }
}
